﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MaLu.Common;
using MaLu.BusiLogic;
using System.Data;

namespace MaluJg.web.ProjectFund
{
    public partial class ProjectDetail : ProjectPage1
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                BindData();
            }
        }

        private void BindData()
        {
            DataTable dt = BLProject.GetProjectDetailList(Provider, Year);
           
            dt.Columns.Add("item1");
            dt.Columns.Add("item2");
            dt.Columns.Add("item3");
            dt.Columns.Add("item4");
            dt.Columns.Add("item5");
            dt.Columns.Add("item6");
            dt.Columns.Add("item7");
            foreach (DataRow item in dt.Rows)
            {
                foreach (DataColumn col in dt.Columns)
                {
                    if (col.ColumnName.StartsWith("item") && !col.ColumnName.EndsWith(".aspx"))
                    {
                        item[col.ColumnName] = "<img src=\"images/green.gif\"";
                        if (item[col.ColumnName+".aspx"].ToString() == "0")
                        {
                            item[col.ColumnName] = "<img src=\"images/gray.gif\"";
                        }
                    
                    }
                }

               
            }
            rptProject.DataSource = dt;
            rptProject.DataBind();
        }
    }
}
